;"use strict";
function NSet(value){
  if(value){
    this.arr = [value];
  }else{
    this.arr = [];
  }
  this.length = this.arr.length;

}

NSet.prototype = {
  constructor:NSet,
  has:function(value){
    return this.arr.indexOf(value) !==-1;
  },
  size:function(){
    return this.arr.length;
  },
  get:function(index){
    return this.arr[index];
  },
  add:function(value){
    if(this.has(value)){
      return false;
    }
    this.arr.push(value);
    this.length = this.arr.length;
    return true;
  },
  remove:function(value){
    if(this.has(value)){
      return false;
    }
    
    this.arr.splice(this.arr.indexOf(value),1);
    this.length = this.arr.length;
  },
  clear:function(){
    this.length = 0;
    this.arr.length = 0;
  },
  toString:function(){
    // if(this.arr.length !=0){
    //   return this.arr.join(",");
    // }
    return this.arr.toString();
  }
};

